package IO流复习;

import java.io.*;
import java.lang.reflect.WildcardType;
import java.net.ServerSocket;
import java.net.Socket;

public class ObjectOutput_TCP2 {
    public static void main(String[] args) throws IOException {
        //服务器
        ServerSocket ss=new ServerSocket(1003);
        //监控客户连接
        Socket accept = ss.accept();
        //接收数据
        InputStream inputStream = accept.getInputStream();
       BufferedInputStream bf =new BufferedInputStream(inputStream);
       int len;
        while ((len=bf.read())!=-1){
            System.out.println((char) len);
        }
        System.out.println("接收成功");
        accept.close();
        ss.close();
    }
}
